<template>
    <!-- // SEQ_VONR_5G语音感知指标_小区(天) -->
    <index-card :indexCardTitle="indexCardTitle">
        <el-table :data="tableData" v-loading="loading">
            <el-table-column prop="startTime" label="开始时间" min-width="200">
                <template #default="scope">
                    {{ scope.row.startTime ? formatDateNormal(scope.row.startTime) : null }}
                </template>
            </el-table-column>
            <el-table-column prop="cgi" label="小区CGI" min-width="200" />
            <el-table-column prop="cellName" label="小区名称" min-width="200" />
            <el-table-column prop="cityName" label="地市名称" min-width="200" />
            <el-table-column prop="vonrVoiceUlMosSum" label="VONR语音上行MOS总和" min-width="200" />
            <el-table-column prop="vonrVoiceUlMosValue" label="VONR语音上行MOS值" min-width="200" />
            <el-table-column prop="vonrVoiceDlMosSum" label="VONR语音下行MOS总和" min-width="200" />
            <el-table-column prop="vonrVoiceDlMosValue" label="VONR语音下行MOS值" min-width="200" />
            <el-table-column prop="cityid" label="地市编号" min-width="200" />
        </el-table>
    </index-card>
</template>

<script setup>
import { ref } from "vue";
import { apiCommon, formatDateNormal } from "@/utils/index.js";
import * as qualityApi from "@/api/biz/networkQuality";
import mittBus from "@/utils/mittBus"; // mitt事件总线

mittBus.on("get5GIndexItemData", (params) => {
    getData(params)
});

const props = defineProps({
    indexCardTitle: {
        type: String,
        default: '',
    },
    rowsData: {
        type: Object,
        default: () => { },
    },
});

const tableData = ref([]);
let loading = ref(false);

const getData = async (params) => {
    // console.log('params', params)

    loading.value = true;
    tableData.value = await apiCommon(qualityApi.getSeqVonrDailyList, params);
    tableData.value = tableData.value.data;
    loading.value = false;
}

getData(props.rowsData);
</script>